﻿@model GameCode.Models.PhoneApp.GameModel
@{
    ViewBag.Title = "游戏特权 - 游戏";
    Layout = "~/Views/Shared/_Layout.cshtml";
    //Layout = null;
}
<div class="gamearea">
    <div class="game_infoarea">
        <div class="game_infoarea_left">
            <img alt="" src="@string.Format("http://{0}/{1}", Request.Url.Host, Model.LogoLink == null ? "" : Model.LogoLink)" />
        </div>
        <div class="game_infoarea_right">
            <div class="game_infoarea_top">
                
                <div class="game_infoarea_name">
                @Model.GameName</div>
                
                <div class="game_infoarea_codename">
                    @Model.RightName
                </div>
            </div>
            <div class="game_infoarea_detail">
                @Model.GameDescription</div>
            <div class="game_infoarea_bottom">
                <div class="game_infoarea_website">
                    @Model.WebSite</div>
                <div class="game_infoarea_time">
                    @Model.OpenDate
                </div>
            </div>
        </div>
    </div>
    <div class="clear line">
    </div>
    <div class="game_codearea">
        @if (Model.Code == null)
        {
            if (Model.TotalCodes > 0)
            {
            <!--未领取-->
            <button class="clean-gray noget" type="button" onclick="loadUrl('PhoneApp/GameFetch?id=@Model.ID')">
                现在领取
            </button>
            }
            else
            {
            <span>领取完毕</span>
            }
        }
        else
        {
            <!--已领取-->
            <div class="game_codearea_geted">
                <span class="get">已领取</span><span>@Model.Code</span>
            </div>
        }
        @if (Model.Code == null)
        {
            if (Model.Rate == 0)
            {
            <div class="ui-progress-bar ui-container game_codeprogress" id="progress_bar">
                <span class="ui-label ui-label-after">已经没有特权码可领取</span>
                <div class="ui-progress" style="@Model.StrRate">
                </div>
            </div>
            }
            else if (Model.Rate >= 60)
            {
            <div class="ui-progress-bar ui-container game_codeprogress" id="progress_bar">
                <div class="ui-progress" style="@Model.StrRate">
                    <span class="ui-label">还有<b class="value">@Model.RemainCodes</b>个特权码</span>
                </div>
            </div>
            }
            else
            {
            <div class="ui-progress-bar ui-container game_codeprogress" id="progress_bar">
                <span class="ui-label ui-label-after">还有<b class="value">@Model.RemainCodes</b>个特权码</span>
                <div class="ui-progress" style="@Model.StrRate">
                </div>
            </div>
            }
        }
    </div>
    <div class="clear line">
    </div>
    <div class="game_remarkarea">
        @Html.Raw(Model.GiftContent)
    </div>
</div>
<div class="clear"></div>